<?php
//登录
Route::get('/login', "LoginController@index")->name('login');
Route::post('/login', "LoginController@login");
Route::get('/logout', "LoginController@logout");
//注册
Route::get('test', function () {
      dd(max("4",5));
});
Route::get('/register', "RegisterController@index");
Route::post('/register', "RegisterController@register");
//首页
Route::get('/', 'PostController@index');
Route::group(['middleware' => 'auth:web'], function () {
    // 文章
    Route::get('/posts/search', 'PostController@search');
    Route::get('/posts/{post}', 'PostController@show')->where(["post" => "[0-9]+"]);
    Route::get('/posts/create', 'PostController@create');
    Route::post('/posts/{post}/delete', 'PostController@delete');
    Route::post('/posts', 'PostController@store');
    Route::get('/posts/{post}/edit', '\App\Http\Controllers\PostController@edit');
    Route::post('/posts/img/upload', '\App\Http\Controllers\PostController@imageUpload');
    Route::post('/posts/comment', 'PostController@comment');
    Route::get('/posts/{post}/zan', '\App\Http\Controllers\PostController@zan');
    Route::get('/posts/{post}/unzan', '\App\Http\Controllers\PostController@unzan');

    // 个人主页
    Route::get('/user/{user}', '\App\Http\Controllers\UserController@show');
    Route::post('/user/{user}/concern', '\App\Http\Controllers\UserController@concern');

    // 个人设置
    Route::get('/user/me/setting', '\App\Http\Controllers\UserController@setting');
    Route::post('/user/me/setting', '\App\Http\Controllers\UserController@settingStore');

    // 专题
    Route::get('/topic/{topic}', '\App\Http\Controllers\TopicController@show');
    Route::post('/topic/{topic}/submit', '\App\Http\Controllers\TopicController@submit');

    // 通知
    Route::get('/notices', 'NoticeController@index');
});





